package apiday01;

public class StringDemo {
    public static void main(String[] args) {
    String s1 = "123acc";
    String s2 = "123"+"acc";
    System.out.println(s1==s2);



     /*String s1 = "123abc";
     String s2 = "123"+"abc";
     System.out.println(s1==s2);

     String s3 ="123";
     String s4 =s3+"abc";
     System.out.println(s3==s4);//false

      */










      /* String s1 = "123abc";
       String s2 = "123abc";
      System.out.println(s1==s2);
      s1=s1+"!";
      System.out.println(s1==s2);

       */









        /* String s1 = "123abc";
        String s2 = "123abc";
        String s3 = "123abc";
        System.out.println(s1==s2);
        System.out.println(s1==s3);
        System.out.println(s2==s3);

        */

        /*String s1 = new String("hello");//s1装的是new String（）对象的地址
        String s2 = "hello";
        System.out.println("s1:"+s1);
        System.out.println("s2:"+s2);
        System.out.println(s1==s2);//false,因为s1与s2的地址不同
        System.out.println(s1.equals(s2));//ture,因为s1与s2的内容相同

         */

    }
}
